package com.motu.monstercity.server.game.logic;

import com.motu.monstercity.server.game.commondata.feast.FeastConstant;
import com.motu.monstercity.server.game.commondata.feast.FeastMain;
import com.motu.monstercity.server.game.userdata.*;
import com.motu.vertx.module.utility.model.EntityManager;
import com.motu.vertx.module.utility.model.Model;
import com.motu.vertx.module.utility.toolset.TimeUtils;

import java.util.ArrayList;
import java.util.List;

public class DrawUserData extends DrawBaseData {
    public static UserTigerDraw getUserTigerDraw(long userId) {
        return (UserTigerDraw) EntityManager.getUniqueEntity(UserTigerDraw.class, userId);
    }

    // 根据dbid 获取TigerDrawRecord
    public static TigerDrawRecord getTigerDrawRecord(int serverId, long dbid) {
        return (TigerDrawRecord) EntityManager.getEntity(TigerDrawRecord.class, serverId, dbid);
    }

    public static List<TigerDrawRecord> getTigerDrawRecordList(int serverId) {
        List<TigerDrawRecord> list = new ArrayList<>();
        for (Model model : EntityManager.getEntityList(TigerDrawRecord.class, serverId)) {
            TigerDrawRecord entity = (TigerDrawRecord) model;
            list.add(entity);
        }
        return list;
    }
}
